package cn.iocoder.yudao.module.digital.dal.mysql.csc;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.digital.dal.dataobject.csc.CscDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.digital.controller.admin.csc.vo.*;

/**
 * 软著 Mapper
 *
 * @author admin
 */
@Mapper
public interface CscMapper extends BaseMapperX<CscDO> {

    default PageResult<CscDO> selectPage(CscPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CscDO>()
                .likeIfPresent(CscDO::getName, reqVO.getName())
                .eqIfPresent(CscDO::getNo, reqVO.getNo())
                .eqIfPresent(CscDO::getAffiliation, reqVO.getAffiliation())
                .eqIfPresent(CscDO::getRegistrationNum, reqVO.getRegistrationNum())
                .betweenIfPresent(CscDO::getPublicationTime, reqVO.getPublicationTime())
                .eqIfPresent(CscDO::getCscType, reqVO.getCscType())
                .eqIfPresent(CscDO::getAuthor, reqVO.getAuthor())
                .eqIfPresent(CscDO::getRate, reqVO.getRate())
                .eqIfPresent(CscDO::getReserved1, reqVO.getReserved1())
                .eqIfPresent(CscDO::getReserved2, reqVO.getReserved2())
                .eqIfPresent(CscDO::getReserved3, reqVO.getReserved3())
                .eqIfPresent(CscDO::getReserved4, reqVO.getReserved4())
                .eqIfPresent(CscDO::getReserved5, reqVO.getReserved5())
                .betweenIfPresent(CscDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CscDO::getRemark, reqVO.getRemark())
                .orderByDesc(CscDO::getId));
    }

}